import React from 'react';
import Immutable from "immutable";

class Child3 extends React.PureComponent {

  constructor(props) {
    super();
    this.state = {
      child: '',
    };
  }

  static getDerivedStateFromProps(nextProps, prevState) {
    console.log("Child3 getDerivedStateFromProps ...", nextProps, prevState);
    return prevState;
  }

  render() {
    return (
      <div>
        我是一个纯展示组件
        { this.props.array.map((item, index) => {
          return item.fruit.map((ele, i) => <li key={i}>{ele}</li>)
        })}
        {/* { this.props.array.toJS().map((item, index) => {
          return item.fruit.map((ele, i) => <li key={i}>{ele}</li>)
        }) } */}
      </div>
    );
  }

  componentDidUpdate(prevProps, prevState) {
    console.log("Child3 componentDidUpdate ...", prevProps, prevState);
  }

}

export default Child3;
